//
//  LogicSB.h
//  tcpoctest
//
//  Created by gump on 11/6/12.
//  Copyright (c) 2012 gump. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface LogicSB : NSObject
{
    char    *mdata;
    int     mlength;
    int     mreadpoint;
    int     mwritepoint;
}

@property(nonatomic) int mrestLength;

-(void)initSB:(char *)data withLength:(int)len;
-(void)cleanSB;

-(char)ReadChar;
-(NSString *)ReadRestString;//读剩余的str
-(int)ReadIntWithTT:(int)itt;//读int值
-(NSString *)ReadUnencodeString;//读一段str
-(NSString *)ReadStringWithLength:(int)il;//根据长度读str
-(NSData *)ReadDataWithLength:(int)ilength;//根据长度读数据（头像、语音）

-(void)WriteString:(NSString *)str withLength:(int)len;
-(void)WriteChar:(char)value;
-(void)WriteInt:(int)value withNTT:(int)intt;
-(void)WriteData:(char *)data withLength:(int)len;
-(void)WriteFixedLengthString:(NSString *)str withLength:(int)len;

@end
